package cn.restcloud.example.controller.fegin;

import java.util.HashMap;

import org.springframework.beans.factory.annotation.Autowired;

import cn.restcloud.framework.core.annotation.bean.BeanConfig;
import cn.restcloud.framework.core.annotation.bean.BeanType;
import cn.restcloud.framework.core.annotation.rest.MethodType;
import cn.restcloud.framework.core.annotation.rest.RestConfig;
import cn.restcloud.framework.view.base.DocAndView;
import cn.restcloud.framework.view.util.ViewUtil;

@BeanConfig(appId = "Hello",beanId = "TestFeignRest",beanName = "TestFeignRest",beanType = BeanType.CONTROLLER)
@RestConfig(url = "/rest/hello/feign")
public class TestFeignRest {

	@Autowired
	private FeginConfigApi feginConfigApi;
	
	@RestConfig(configName = "测试api",configId="HELLO_API_181023018",method = MethodType.GET,url = "/test")
	public DocAndView testFeign() throws Exception{
		
		String serverInfo=feginConfigApi.getServrerInfo();
		HashMap<String,String> userMap=new HashMap<String,String>();
		userMap.put("userId", "admin");
		userMap.put("userObjs", "");
		String userInfo=feginConfigApi.getUserInfo(userMap);
		
		return ViewUtil.getJsonView(serverInfo+userInfo);
	}
	
}
